#include<iostream>
using namespace std;
template<typename T>
void my(T* a) {
	int i = 1;
	for (int i = 0; i < 5; i++) {
		if (a[i] > a[i + 1]) {
			i = 0;
			cout << "Invalid" << endl;
			return;
		}
	}
	cout << "Valid" << endl;
}
int main()
{
	char c;
	while (cin >> c) {
		if (c == 'i') {
			int* a = new int[6];
			for (int i = 0; i < 6; i++) {
				cin >> a[i];
			}
			my(a);
		}
		else if (c == 'c') {
			char* a = new char[6];
			for (int i = 0; i < 6; i++) {
				cin >> a[i];
			}
			my(a);
		}
		else if (c == 'f') {
			float* a = new float[6];
			for (int i = 0; i < 6; i++) {
				cin >> a[i];
			}
			my(a);
		}
	}
	return 0;
}